package com.ce.pms.log4ce;

import java.util.Map;

import org.aspectj.lang.JoinPoint;

import com.ce.component.log4ce.aop.constructor.support.AbstractOriginalObjectHolder;
import com.ce.component.log4ce.aop.constructor.support.OriginalObjectHolder;
import com.ce.component.log4ce.aop.parser.BizLogParser;
import com.ce.pms.customer.vo.IndividualVO;
import com.ce.pms.customer.vo.MemberVO;

public class MemberEditHolder extends AbstractOriginalObjectHolder implements OriginalObjectHolder {

	private Log4ceHelper log4ceHelper = Log4ceHelper.getInstance();
	@Override
	protected Map<String, Object> getOriginalObjects(JoinPoint joinPoint, BizLogParser logParser) {
		Map<String,Object> map = logParser.getLogArguments(joinPoint);

		//获取被代理方法的参数，此map中的key值在Log4ceLogCfg.xml中的LogArguments节点中定义。
		MemberVO memberVO = (MemberVO) map.get("membervo");

		//获取参与人ID
		Long participantId = memberVO.getParticipantId();

		//获取个人信息
		IndividualVO individual = log4ceHelper.getMemberService().findIndividualById(participantId);
		map.put("oldMemberInfo", individual);
		return map;
	}
}
